package com.fan_main;

public class Record
{
	String time;
	String link;
	String title;
	String webname;
	public String getWebname() {
		return webname;
	}
	public String getTime() {
		return time;
	}
	public void setTime(String time) {
		this.time = time;
	}
	public String getLink() {
		return link;
	}
	public void setLink(String link) {
		this.link = link;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public int totime()
	{
		if(time.length()<15)
		{
			return   Integer.parseInt(time.substring(0,4))*372
					+Integer.parseInt(time.substring(5,7))*31
					+Integer.parseInt(time.substring(8,10));
		}
		else
		{
	
			return (Integer.parseInt(time.substring(0,4))*372
					   +Integer.parseInt(time.substring(5,7))*31
					   +Integer.parseInt(time.substring(8,10)))*24*60
					   +Integer.parseInt(time.substring(11,13))*60
					   +Integer.parseInt(time.substring(14,16));
			
			
		}
		
	}
	
	static public int str2time(String str)
	{
		if(str.length() <15)
		{
			return  Integer.parseInt(str.substring(0,4))*372
				   +Integer.parseInt(str.substring(5,7))*31
				   +Integer.parseInt(str.substring(8,10));
			
		}
		else
		{
			return (Integer.parseInt(str.substring(0,4))*372
					   +Integer.parseInt(str.substring(5,7))*31
					   +Integer.parseInt(str.substring(8,10)))*24*60
					   +Integer.parseInt(str.substring(11,13))*24
					   +Integer.parseInt(str.substring(14,16));
			
		}
	
	}

	public String toString()
	{

		return this.time+":"+this.title+":"+this.link;
		
	}
	public boolean equals(Object o){
		if(! (o instanceof Record) ) return false;
		Record rec=(Record)o;
		return this.link.equals(rec.link) && this.title.equals(rec.title);		
	}
	public int hashcode(){
		return super.hashCode();
	}
}
